<?php
/**
 * Niushop商城系统 - 团队十年电商经验汇集巨献!
 * =========================================================
 * Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
 * ----------------------------------------------
 * 官方网址: https://www.niushop.com
 * =========================================================
 */

namespace addon\weapp\event;

use addon\weapp\model\Weapp;

/**
 * 订单发货完成，小程序发货信息录入
 */
class OrderDeliveryAfter
{

    public function handle($data)
    {
        $order_info = model('order')->getInfo([ [ 'order_id', '=', $data[ 'order_id' ] ] ], 'order_from');
        if($order_info['order_from'] == 'weapp'){
            $weapp_model = new Weapp($data[ 'site_id' ]);
            $res = $weapp_model->orderShippingUploadShippingInfo([
                'order_id' => $data[ 'order_id' ],
            ]);
            return $res;
        }
    }
}